<template>
    <div class="rightContent">
        <div class="back" @click="back"><img src="@/assets/images/monitor/back.png" /> <label>返回</label></div>

        <div v-if="type == '1'">
            <deviceCount :currentNodeId="currentNodeId" :currentNodeName="currentNodeName" type="2"></deviceCount>
        </div>
        <div v-if="type == '2'">
            <deviceElec :currentNodeId="currentNodeId" :currentNodeName="currentNodeName" type="2"></deviceElec>
        </div>
        <div v-if="type == '3'">
            <deviceWater :currentNodeId="currentNodeId" :currentNodeName="currentNodeName" type="2"></deviceWater>
        </div>
        <div v-if="type == '4'">
            <deviceInter :currentNodeId="currentNodeId" :currentNodeName="currentNodeName" type="2"></deviceInter>
        </div>
    </div>
</template>

<script>
import deviceCount from './deviceCount.vue'
import deviceElec from './deviceElec'
import deviceWater from './deviceWater'
import deviceInter from './deviceInter'
export default {
    components: {
        deviceCount,
        deviceElec,
        deviceInter,
        deviceWater
    },
    props: ['type', 'currentNodeId', 'currentNodeName'],
    data() {
        return {}
    },
    methods: {
        back() {
            this.$emit('back', 'elec')
        }
    }
}
</script>

<style lang="scss" scoped>
.rightContent {
    height: calc(100vh - 123px);
    flex: 1;
    text-align: left;
    padding-top: 2px;
    .deviceTree {
        padding: 10px;
        // overflow-y: auto;
        height: calc(100vh - 160px);
    }
    .back {
        height: 28px;
        line-height: 28px;
        text-align: left;
        padding-left: 10px;
        cursor: pointer;
        border-bottom: 1px solid #e0e0e0;
        img {
            float: left;
            display: block;
            cursor: pointer;
            margin-right: 0;
            margin-top: 4px;
        }
        label {
            cursor: pointer;
        }
    }
}
</style>
